function f = elliptic_f(x,y,caseNum,varargin)
switch caseNum
    case 1
        f = ones(size(x));
    case 2
        f = -4*ones(size(x));
    case 3
        f = y*0;
    case 4
        f = y*0;
    case 5
        f = ones(size(x));
    case 6
        epsilon = varargin{1};
        f = 1-(exp(-x/epsilon)+exp((x-1)/epsilon))/(1+exp(-1/epsilon)).*(exp(-y/epsilon)+exp((y-1)/epsilon))/(1+exp(-1/epsilon));
    case 7
        e = varargin{1};
        f = -8*e*(9+16*x.^2-16*y.^2.*x+4*e^2-12*y.^2-40*x-12*y.^4)./(4*e^2+4*y.^4+16*y.^2.*x-4*y.^2+16*x.^2-8*x+1).^2;
    otherwise
        f = 0;
end